<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('order', function (Blueprint $table) {
            //
            $table->dropColumn('pay_money');
        });

        Schema::table('order_transaction',function (Blueprint $table){

            $table->unique('order_id_array');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('order', function (Blueprint $table) {
            //
            $table->decimal('pay_money')->nullable()->unsigned()->comment('实际支付金额');

        });

        Schema::table('order_transaction',function (Blueprint $table){

            $table->dropUnique('order_id_array');

        });

    }
}
